package 练习程序;

public class 一百以内素数的和 {
    public static void main(String[] args) {
        System.out.println(sumInt(3, 10));

    }

    public static long sumInt(int n, int m) {
        int sum = 0;
        for (int i = n; i <= m; i++) {
            boolean a = true;
            for (int j = 2; j < i; j++) {
                if (i % j == 0) {
                    a = false;
                    break;

                }
            }
            if (a) {
                sum = sum + i;

            }
        }
        return sum;
    }
}


